home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / Framework / Includes / UDeskScrapView.h < prev    next >
Encoding:
Text File  |  1996-04-03  |  3.7 KB  |  115 lines  |  [TEXT/MPS ]

  1. // UDeskScrapView.h
  2. // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
  3.  
  4. #ifndef __UDESKSCRAPVIEW__
  5. #define __UDESKSCRAPVIEW__
  6.  
  7. // MacApp
  8.  
  9. #ifndef __UGEOMETRY__
  10. #include "UGeometry.h"
  11. #endif
  12.  
  13. #ifndef __UVIEW__
  14. #include "UView.h"
  15. #endif
  16.  
  17. //----------------------------------------------------------------------------------------
  18. // Forward and external class declarations
  19. //----------------------------------------------------------------------------------------
  20.  
  21. class TDocument;
  22.  
  23.  
  24. //----------------------------------------------------------------------------------------
  25. // TDeskScrapView: The default view in the Clipboard, able to display only standard text
  26. // and pictures.
  27. //----------------------------------------------------------------------------------------
  28.  
  29. class TDeskScrapView : public TView
  30. {
  31.     MA_DECLARE_CLASS;
  32.     
  33. public:
  34.     //------------------------------------------------------------------------------------
  35.     // Initialize and Free
  36.     //------------------------------------------------------------------------------------
  37.  
  38.     TDeskScrapView();
  39.         // Constructor
  40.         
  41.     void IDeskScrapView();
  42.         // Initialize the deskscrap view procedurally.
  43.  
  44.     virtual ~TDeskScrapView();
  45.         // Destructor. 
  46.  
  47.     virtual void Free(); // override
  48.         // Does nothing, don't ever want to free the clip orphanage.
  49.  
  50.  
  51.     //------------------------------------------------------------------------------------
  52.     // Stream I/O protocol support.
  53.     //------------------------------------------------------------------------------------
  54.  
  55.     virtual void ReadFields(TStream* aStream);
  56.         // Initialize the fScrapCount.
  57.  
  58.     //------------------------------------------------------------------------------------
  59.     // Other methods
  60.     //------------------------------------------------------------------------------------
  61.  
  62.     virtual void CheckScrapContents();
  63.         // Checks the contents of the deskscrap.
  64.  
  65.     virtual VRect CalcMinFrame();
  66.         // Responsible for calculating the correct size for the deskscrap view.
  67.  
  68.     virtual void Draw(const VRect& area);
  69.         // Handles the drawing of the contents of the deskscrap, which by default is
  70.         // either a PICT or text.
  71.  
  72.     virtual void SuperViewChangedFrame(const VRect& oldFrame,
  73.                                             const VRect& newFrame,
  74.                                             Boolean invalidate);
  75.         // If our superview changes size then call AdjustSize & ForceRedraw.
  76.  
  77.     virtual void WriteToDeskScrap();
  78.         // This view represents data that is already written to the deskscrap, so this
  79.         // does nothing.
  80.  
  81.     //------------------------------------------------------------------------------------
  82.     // static member functions
  83.     //------------------------------------------------------------------------------------
  84. protected:
  85.     static Boolean LookForScrapType(ResType theResType, ResType& resTypeFound);
  86.  
  87.     //------------------------------------------------------------------------------------
  88.     // data members
  89.     //------------------------------------------------------------------------------------
  90. public:
  91.     Handle fDataHandle;                            // if non-NULL, will be either a PicHandle
  92.                                                 // to my picture or a Handle to my Text
  93.  
  94.     short fScrapCount;                            // scrapCount of the scrap represented by
  95.                                                 // this view.
  96.  
  97.     Boolean fHavePicture;                        // are we holding a PICT
  98.  
  99.     Boolean fHaveText;                            // is there any TEXT
  100.  
  101.     //----------------------------------------------------------------------------------------
  102.     // static data members
  103.     //----------------------------------------------------------------------------------------
  104. public:
  105.     static Boolean gVarClipPicSize;
  106.         // If true, pictures in the Clipboard are treated as variable size, depending on the
  107.         // window size; if false (default), then pictures in the Clipboard are drawn and
  108.         // pasted ??? actual size
  109.  
  110. };
  111.  
  112. #endif
  113.  
  114.  
  115.